<!DOCTYPE html>
<html>
	<head>
		<title>商品分类-详情</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<!-- 所有的 css js 资源 -->
		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
		<link rel="stylesheet" href="../../static/sa.css"> 
		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
		<script src="../../static/sa.js"></script>
		<style type="text/css">
			.c-panel .c-label{width: 8em;}
			.c-item .image-box-2{height: 90px;}
		</style>
	</head>
	<body>
		<div class="vue-box sbot" style="display: none;" :style="'display: block;'">
			<!-- ------- 内容部分 ------- -->
			<div class="s-body">
				<div class="c-panel">
					<el-form v-if="m">
						<sa-info name="分类id" br>{{m.id}}</sa-info>
						<sa-info name="分类名字" br>{{m.name}}</sa-info>
						<sa-info name="分类图标" :value="m.icon" type="img" br></sa-info>
						<sa-info name="排序索引" br>{{m.sort}}</sa-info>
						<sa-info name="创建日期" br>{{sa.forDatetime(m.create_time)}}</sa-info>
					</el-form>
				</div>
			</div>
			<!-- ------- 底部按钮 ------- -->
			<div class="s-foot">
				<el-button @click="sa.closeCurrIframe()" type="success">确定</el-button>
				<el-button @click="sa.closeCurrIframe()">取消</el-button>
			</div>
		</div>
		<script src="./moke-data.js"></script>
		<script>
			var app = new Vue({
				components: {
					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),		
				},
				el: '.vue-box',
				data: {
					id: sa.p('id', 0),	// 获取数据ID 
					m: null
				},
				methods: {
				},
				mounted: function() {
					sa.ajax2('/SysType/getById?id=' + this.id, function(res) {
						this.m = res.data;
					}.bind(this), {res: getById(this.id)})
				}
			})
			
			// 获取对应的data 
			function getById(id) {
				var res = {
					code: 200,
					msg: 'ok',
					data: null
				};
				getMockData().data.forEach(function(item) {
					if(item.id == id) {
						res.data = item;
					}
				})
				return res;
			}
		</script>
	</body>
</html>
